package com.htj.setting.web.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.htj.setting.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;

@Controller
@ResponseBody
public class Test {
    @Autowired
    UserDao dao;
    @RequestMapping(value = "/test.do",produces = "html/text;charset=utf-8")
    public String get(HttpServletResponse response) throws JsonProcessingException {

        ObjectMapper objectMapper = new ObjectMapper();
//        String json = objectMapper.writeValueAsString(dao.getUser(1));
//        System.out.println(json);
//        return json;
        return "";
    }
}
